package com.java.miaosha.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.java.miaosha.dao.MiaoshaGoodsDao;
import com.java.miaosha.entity.MiaoshaGoodsEntity;
import com.java.miaosha.service.MiaoshaGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service("miaoshaGoodsService")
public class MiaoshaGoodsServiceImpl extends ServiceImpl<MiaoshaGoodsDao, MiaoshaGoodsEntity> implements MiaoshaGoodsService {
	@Autowired
	private MiaoshaGoodsDao miaoshaGoodsDao;

	@Override
	public boolean reduceStock(Long goodsId) {
		int i = miaoshaGoodsDao.reduceStock(goodsId);
		return i > 0;
	}
}